//
//  Home_LotteryModel.m
//  WanCaiC8
//
//  Created by tangang on 2018/3/1.
//  Copyright © 2018年 tangang. All rights reserved.
//

#import "Home_LotteryModel.h"

@implementation Home_LotteryModel

- (void)setOpenNum:(NSString *)OpenNum{
    _OpenNum=OpenNum;
    _numArr=[OpenNum componentsSeparatedByString:@","];
    NSInteger count=0;
    for (int i=0; i<_numArr.count; i++) {
        [self.PCArr addObject:_numArr[i]];
        count+=[_numArr[i] integerValue];
        [self.PCArr addObject:@"+"];
    }
    [self.PCArr replaceObjectAtIndex:self.PCArr.count-1 withObject:@"="];
    [self.PCArr addObject:[NSString stringWithFormat:@"%ld",count]];
    
    [self.LotteryArr addObjectsFromArray:_numArr];
    [self.LotteryArr insertObject:@"+" atIndex:_numArr.count-1];
    
    
    [self.BringsArr addObjectsFromArray:_numArr];
    [self.BringsArr insertObject:@"+" atIndex:_numArr.count-2];
}

- (void)setOpenTime:(NSString *)OpenTime{
    _OpenTime=[OpenTime stringByReplacingOccurrencesOfString:@"&" withString:@":"];
}

- (void)setOpenNumAlias:(NSString *)OpenNumAlias{
    _aliasNumArr=[OpenNumAlias componentsSeparatedByString:@","];
}

- (NSArray *)results{
    if (!_results) {
        _results=@[@"计划",@"历史",@"发帖",@"排行",@"资讯"];
    }
    return _results;
}

- (NSMutableArray *)PCArr{
    if (!_PCArr) {
        _PCArr=[[NSMutableArray alloc]init];
    }
    return _PCArr;
}

- (NSMutableArray *)LotteryArr{
    if (!_LotteryArr) {
        _LotteryArr=[[NSMutableArray alloc]init];
    }
    return _LotteryArr;
}

- (NSMutableArray *)BringsArr{
    if (!_BringsArr) {
        _BringsArr=[[NSMutableArray alloc]init];
    }
    return _BringsArr;
}

@end
